package ldkxingzhe.ldkxingzhedemo.tab;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TabHost;

import ldkxingzhe.ldkxingzhedemo.R;


/**
 * Created by ke on 15-8-24.
 */
public class TabHostActivity extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tab_host);

        TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
        tabHost.setup();

        tabHost.addTab(tabHost.newTabSpec("TAB1").setIndicator("标签1",
                getResources().getDrawable(R.drawable.adward_box_1)).setContent(R.id.tab1));
        tabHost.addTab(tabHost.newTabSpec("TAB2").setIndicator("标签2",
                getResources().getDrawable(R.drawable.adward_box_2)).setContent(R.id.tab2));
        tabHost.addTab(tabHost.newTabSpec("TAB3").setIndicator("标签3",
                getResources().getDrawable(R.drawable.adward_box_3)).setContent(R.id.tab3));
    }
}
